<?php

function my_links_filter ($str) {
    //return (preg_match ('/^links-[0-9]+$/', $str) ? false : true);
    return (0 === strpos ($str, 'links-') ? false : true);
}

function my_disable_widgets ($arr) {
    if (is_array ($arr) && (is_home() || is_front_page ())) {
	foreach ($arr as $key => $value) {
	    $arr[$key] = array_filter ($value, 'my_links_filter');
	}
    }
    return $arr;
}
add_filter ('sidebars_widgets', 'my_disable_widgets');

?>
